package main;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Map;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

import model.Animal;
import model.Simulator;

import controller.AbstractController;
import controller.ParamController;
import controller.StepsController;


import view.AbstractView;
import view.FieldView;
import view.HistorieGramView;
import view.PieView;
import view.ProgGraph;
import view.StatsView;
import view.TextView;



public class Application extends JFrame {
	
	private static final long serialVersionUID = -7085266268018778071L;
	private Simulator simulator;
    private AbstractController stepsController;
    private AbstractController paramController;
    private AbstractController menuController;
    
    private AbstractView statsView;
    private AbstractView fieldView;
    private AbstractView pieView;
    private AbstractView historieGramView;
    private AbstractView progGraph;
    private JPanel controls;
    private JPanel viewPanel;
	private AbstractView textView;
	
	    
    public Application() {    
    	simulator = new Simulator();
        stepsController = new StepsController(simulator);
        paramController = new ParamController(simulator);
       
        
        
        statsView = new StatsView(simulator);
        fieldView = new FieldView(simulator);
        pieView = new PieView(simulator);
        textView = new TextView(simulator);
        historieGramView = new HistorieGramView(simulator);
        progGraph = new ProgGraph(simulator);
        
        
        controls = new JPanel();
        controls.setLayout(new BoxLayout(controls, BoxLayout.PAGE_AXIS));
        controls.add(stepsController);
        controls.add(paramController);
        this.setLayout(null);
        this.setTitle("Fox and Rabbit Simulation");
	    this.setSize(800, 800);
	    this.setResizable(true);
	    fieldView.setBounds(0,0,300,300);
	    this.add(fieldView);
	    pieView.setBounds(310,0,300,300);
	    this.add(textView);
	    textView.setBounds(725,320,300,300);
	    this.add(pieView);
	    historieGramView.setBounds(620,0,300,300);
	    this.add(historieGramView);
	    statsView.setBounds(0,310,400,50);
	    this.add(statsView);
	    progGraph.setBounds(0,450,750,425);
	    this.add(progGraph);
	    
	    controls.setBounds(0,360,400,100);
	    this.add(controls);
	    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	    this.setVisible(true);            
	}
    
    
}
